<!doctype html>
<html class="no-js">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>{$meta_title}</title>
  
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <link rel="icon" type="image/png" href="">
  <link rel="apple-touch-icon-precomposed" href="">
  <meta name="apple-mobile-web-app-title" content="{$meta_title}" />
  <link rel="stylesheet" href="__ROOT__/Application/Home/View/default/assets/css/amazeui.min.css"/>
  <link rel="stylesheet" href="__ROOT__/Application/Home/View/default/assets/css/admin.css">
  <link rel="stylesheet" href="__ROOT__/Application/Home/View/default/assets/css/mycss.css">
  <script src="__PUBLIC__/js/laydate/laydate.js"></script>
  <script type="text/javascript" src="__PUBLIC__/libs/dingding/javascripts/zepto.min.js"></script>
   <script type="text/javascript" src="http://g.alicdn.com/dingding/dingtalk-pc-api/2.6.2/index.js"></script>
   <style type="text/css">
		.am-form div.am-text-right{padding:7px 0;}
	</style>
</head>
<body>

<div class="am-cf admin-main">
  <!-- sidebar start -->
  <div class="admin-sidebar am-offcanvas" id="admin-offcanvas">
    <div class="am-offcanvas-bar admin-offcanvas-bar">
      <ul class="am-list admin-sidebar-list">
        <li ><a href="#"><span><img alt="{$user_info.name}" src="{$user_info.avatar}"  style="display: block; margin: 0 auto; width: 80%;border-radius: 50%;"></span> {$user_info.name}</a></li>
        <li ><a href="/Home/Task/shouye"><span class="am-icon-home"></span> 首页</a></li>
        <li class="nav-active"><a href="/Home/Customer/index"><span class="am-icon-user-md"></span>客户</a></li>
                
      </ul>
      
    </div>
  </div>
  <!-- sidebar end -->

<!-- content start -->
<div class="admin-content" style="overflow-y: scroll;">
  <div class="admin-content-body">
    <div class="am-cf am-my-title">{$meta_title}</div>
      
<form class="am-form" id="customerform" action="{:U('Home/Customer/add')}" method="post">

			   <div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-2 am-text-right">客户级别</div>
	            <div class="am-u-sm-8 am-u-md-4 am-u-end ">
	              <select name="level" >
	              	<volist name="customer_level" id="vo" >
	              	 <option value="{$vo.id}">{$vo.title}</option>
	                
	                </volist>
	              </select>
	            </div>
	          </div>  
	          
	          <div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-2 am-text-right">来源</div>
	            <div class="am-u-sm-8 am-u-md-4 am-u-end ">
	              <select name="source" id="">
	              	<volist name="customer_source" id="vo" key="k">
	                <option value="{$vo.id}">{$vo.title}</option>
	                </volist>
	              </select>
	            </div>
	          </div>     
			          
	          <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                客户名
              </div>
              <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                <input type="text" class="am-input-sm" name="customer_name" >
              </div>
            </div>  
            
            <div class="am-g am-margin-top">
            <div class="am-u-sm-4 am-u-md-2 am-text-right">客户性别</div>
            <div class="am-u-sm-8 am-u-md-10">
              <div class="am-btn-group" data-am-button>
              	<volist name="USER_SEX_LIST" id="vo" >
	             <label class="am-btn am-btn-default am-btn-xs">
                  <input type="radio" name="sex"  value="{$key}"> {$vo}
                 </label>
                </volist> 
              </div>
            </div>
          </div>
            
            <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                公司名
              </div>
              <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                <input type="text" class="am-input-sm" name="company" >
              </div>
            </div>  
            
                       
            <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                QQ
              </div>
              <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                <input type="text" class="am-input-sm" name="qq" >
              </div>
            </div>  
            
            <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                微信号
              </div>
              <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                <input type="text" class="am-input-sm" name="wechat" >
              </div>
            </div>  
             
             <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                办公电话
              </div>
              <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                <input type="text" class="am-input-sm" name="phone" >
              </div>
            </div>  
            
            <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                手机号
              </div>
              <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                <input type="text" class="am-input-sm" name="mobile" >
              </div>
            </div>  
            
            <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                邮箱
              </div>
              <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                <input type="text" class="am-input-sm" name="email" >
              </div>
            </div>  
            
            <div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-2 am-text-right">城市</div>
	            <div class="am-u-sm-8 am-u-md-4 am-u-end ">
	              <select name="province" id="province_id" onchange="change_province();">
	              	<option >选择省份</option>
	              	<volist name="province" id="vo" key="k">
	                <option value="{$vo.id}">{$vo.name}</option>
	                </volist>
	              </select>
	              <select name="city" id="city_id">
	              	
	              </select>
	            </div>
	          </div>  
              
              <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                地址
              </div>
              <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                <input type="text" class="am-input-sm" name="address" >
              </div>
            </div>  
                       
             <div class="am-g am-margin-top">
	            <div class="am-u-sm-4 am-u-md-2 am-text-right">客服</div>
	            <div class="am-u-sm-8 am-u-md-4 am-u-end ">
	              <select name="customer_service_id" id="">
	              	<volist name="kefu_arr" id="vo" key="k">
	                <option value="{$vo.id}">{$vo.title}</option>
	                </volist>
	              </select>
	            </div>
	          </div>  
          
         <!--  <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                推荐人
              </div>
              <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                <input type="text" class="am-input-sm" name="recommended" >
              </div>
            </div>  
            
            <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                父客户编号（父客户id）
              </div>
              <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                <input type="text" class="am-input-sm" name="parent_customerid" >
              </div>
            </div>   -->
          
            <div class="am-g am-margin-top-sm">
              <div class="am-u-sm-12 am-u-md-2 am-text-right admin-form-text">
                备注
              </div>
              <div class="am-u-sm-12 am-u-md-6 am-u-end">
                <textarea rows="4" name="remark" placeholder="请填写备注"></textarea>
              </div>
            </div>

          </form>
   
   <div class="am-g am-margin-top am-margin">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">&nbsp;&nbsp;</div>
              <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                 <button type="button" class="am-btn am-btn-primary am-btn-xs" id="savecustomer">提交保存</button>
      			 <button type="button" class="am-btn am-btn-primary am-btn-xs" onClick="javascript :history.back(-1);">放弃保存</button>
    		  </div>
          </div> 
	

  </div>
</div>
<!-- content end -->

</div>

<script type="text/javascript" >

//选择城市
function change_province(){
	var keyword=$('#province_id option:selected') .val();
	var params = {};
	params.keyword=keyword;
	
	var url="{:U('Home/Customer/getCityAjax')}";
	$.post(url,params,function(data) {
		
			$('#city_id').html(data);
		
	});
}



//提交表单
	$('#savecustomer').click(function(){
	 	$('#customerform').submit();
	});
</script>

<script src="__ROOT__/Application/Home/View/default/assets/js/jquery.min.js"></script>

<script src="__ROOT__/Application/Home/View/default/assets/js/amazeui.min.js"></script>
<script src="__ROOT__/Application/Home/View/default/assets/js/app.js"></script>
</body>
</html>
